﻿@using GSLMS.WebAPP
@model GSLMS.Entity.TB_APP_PROINFO
@{
    Layout = null;
    var ddlCustList = ViewData["CustList"] as SelectList;
    var ddlLoanType = ViewData["LoanType"] as SelectList;
    var ddlProduct = ViewData["Product"] as SelectList;
    var ddlSource = ViewData["Source"] as SelectList;
    var ddlDocType = ViewData["DocType"] as SelectList;
    var ddlRepayment = ViewData["Repayment"] as SelectList;

    var ShareHolderInfos = Model.ProShareHolderInfos ?? new List<GSLMS.Entity.TB_APP_SHAREHOLDERINFO>();
    int index = 0;
    Model.AduRiskControl = Model.AduRiskControl ?? new GSLMS.Entity.TB_ADU_RISKCONTROL();
    Model.ProUnForHouInfo = Model.ProUnForHouInfo ?? new GSLMS.Entity.TB_APP_PROUNFORHOUINFO();
    
}
<div class="pageContent">
    <div class="tabs" currentindex="0" eventtype="click">
        <div class="tabsHeader">
            <div class="tabsHeaderContent">
                <ul>
                    <li><a href="javascript:;"><span>立项申请信息</span></a></li>
                    @if (Model.ID > 0)
                    {
                        <li><a href="DianDang/Apply/ProInfo/MetInfoCreate/@Model.ID?proID=@Model.ID" class="j-ajax">
                            <span>材料收集清单</span></a></li>
                        <li><a href="javascript:;"><span>共同借款人</span></a></li>
                        <li><a href="javascript:;"><span>联系人</span></a></li>
                        <li><a href="javascript:;"><span>附件</span></a></li>
                        <li><a href="javascript:;" onclick="GetSumbit()"><span>提交</span></a></li>
                    }
                </ul>
            </div>
        </div>
        <div class="tabsContent">
            <div>
                <form method="post" action="DianDang/Apply/ProInfo/Create?OpID=@ViewData["OperateID"]" class="pageForm required-validate"
    onsubmit="return validateCallback(this, dialogReloadAjaxDone)">
                @Html.ValidationSummary(true)
                <div class="pageFormContent" layouth="100">
                    @Html.HiddenFor(model => model.ID)
                    @Html.HiddenFor(model => model.REGINFOID)
                    @Html.Hidden("RefRegInfoSubmitButton")
                    <p>
                        <label>
                            申请编号：</label>
                        @Html.TextBoxFor(model => model.APPLYNO, new { @class = "", @readonly = "true", @alt = "自动生成" })
                        @Html.ValidationMessageFor(model => model.APPLYNO)
                    </p>
                    <p>
                        <label>
                            贷款类型：</label>
                        @Html.DropDownListFor(model => model.LOANTYPE, ddlLoanType, new { @class = "combox", @selectedvalue = Model.LOANTYPE })
                        @Html.ValidationMessageFor(model => model.LOANTYPE)
                    </p>
                    <p>
                        <label>
                            业务经理：</label>
                        @Html.TextBoxFor(model => model.SALESMAN, new { @class = "", @readonly = "true" })
                        @Html.ValidationMessageFor(model => model.SALESMAN)
                        @Html.HiddenFor(model => model.SALESMANID)
                    </p>
                    <p>
                        <label>
                            所属部门：</label>
                        @Html.TextBoxFor(model => model.DEPNAME, new { @readonly = "true" })
                        @Html.ValidationMessageFor(model => model.DEPNAME)
                        @Html.HiddenFor(model => model.DEPID)
                    </p>
                    <p>
                        <label>
                            申请日期：</label>
                        @Html.TextBoxFor(model => model.APPDATE, new { @class = "date", format = "yyyy-MM-dd", @maxDate = "%y-%M-%d", @readonly = "true", formatDate = "yyyy-MM-dd" })
                        @Html.ValidationMessageFor(model => model.APPDATE)
                    </p>
                    <p>
                        <label>
                            业务类型：</label>
                        @Html.HiddenFor(model => model.BUSSTYPE)
                        @if (Model.BUSSTYPE == 1)
                        {
                            <span>典当 </span>
                        }
                        else if (Model.BUSSTYPE == 2)
                        { 
                            <span>期间借款 </span>
                        }
                    </p>
                    <p>
                        <label>
                            贷款产品：</label>
                        @Html.DropDownListFor(model => model.PRODUCTID, ddlProduct, new { @class = "combox", @selectedvalue = Model.PRODUCTID, @sumbitText = "PRODUCTNAME" })
                        @Html.ValidationMessageFor(model => model.PRODUCTID)
                    </p>
                    <p>
                        <label>
                            来源渠道：</label>
                        @Html.DropDownListFor(model => model.SOURCE, ddlSource, new { @class = "combox", @selectedvalue = Model.SOURCE })
                        @Html.ValidationMessageFor(model => model.SOURCE)
                    </p>
                    <p>
                        <label>
                            中介人：</label>
                        @Html.TextBoxFor(model => model.MEDIATOR, new { @class = "", @readonly = "true" })
                        @Html.ValidationMessageFor(model => model.MEDIATOR)
                        @Html.HiddenFor(model => model.MEDIATORID)
                    </p>
                    <p>
                        <label>
                            中介人账号：</label>
                        @Html.TextBoxFor(model => model.MEDIATORACCOUNT, new { @class = "" })
                        @Html.ValidationMessageFor(model => model.MEDIATORACCOUNT)
                    </p>
                    <p>
                        <label>
                            中介人手机号：</label>
                        @Html.TextBoxFor(model => model.MEDIATORTEL, new { @class = "" })
                        @Html.ValidationMessageFor(model => model.MEDIATORTEL)
                    </p>
                    <div class="divider" />
                    <p style="width: 100px">
                        <label>
                            存在特批：</label>
                        <dl style="width: 100px">
                            <dt style="width: 30px">@(Model.ISSPECIAL == 1 ? "是" : "否")</dt>
                            @if (Model.ISSPECIAL > 0)
                            {
                                <dt style="width: 50px">&nbsp; <a class="button" href="DianDang/Apply/SpecailInfo/Details/@Model.SPECID?OpID=@ViewData["OperateID"]" Target="dialog" >
                                    <span>查看</span></a></dt>
                            }
                        </dl>
                    </p>
                    <p>
                        <label>
                            跟进风控:</label>
                        @Model.AduRiskControl.AUDITBY
                    </p>
                    <div class="divider" />
                    <p>
                        <label>
                            客户名称：</label>
                        @Html.TextBoxFor(model => model.CUSTNAME, new { @class = "", @readonly = "true" })
                        @Html.ValidationMessageFor(model => model.CUSTNAME)
                    </p>
                    <p>
                        <label>
                            证件类型：</label>
                        @Html.DropDownListFor(model => model.DOCTYPE, ddlDocType, new { @class = "combox", @selectedvalue = Model.DOCTYPE, @sumbitText = "DOCTYPENAME" })
                        @Html.ValidationMessageFor(model => model.DOCTYPE)
                    </p>
                    <p>
                        <label>
                            证件号码：</label>
                        @Html.TextBoxFor(model => model.CUSTNO, new { @class = "required" })
                        @Html.ValidationMessageFor(model => model.CUSTNO)
                    </p>
                    <p>
                        <label>
                            联系人：</label>
                        @Html.TextBoxFor(model => model.CONTACT, new { @class = "" })
                        @Html.ValidationMessageFor(model => model.CONTACT)
                    </p>
                    <p>
                        <label>
                            联系人手机1：</label>
                        @Html.TextBoxFor(model => model.CONTRACTTEL, new { @class = "" })
                        @Html.ValidationMessageFor(model => model.CONTRACTTEL)
                    </p>
                    <p>
                        <label>
                            联系人手机2：</label>
                        @Html.TextBoxFor(model => model.CONTRACTTEL2, new { @class = "" })
                        @Html.ValidationMessageFor(model => model.CONTRACTTEL2)
                    </p>
                    <p>
                        <label>
                            法定代表人：</label>
                        @Html.HiddenFor(model => model.ProUnForHouInfo.REGINFOID)
                        @Html.TextBoxFor(model => model.ProUnForHouInfo.LEGAL, new { @class = "" })
                        @Html.ValidationMessageFor(model => model.ProUnForHouInfo.LEGAL)
                    </p>
                    <p>
                        <label>
                            法定代表人手机1：</label>
                        @Html.TextBoxFor(model => model.ProUnForHouInfo.LEGALTEL, new { @class = "" })
                        @Html.ValidationMessageFor(model => model.ProUnForHouInfo.LEGALTEL)
                    </p>
                    <p>
                        <label>
                            法定代表人手机2：</label>
                        @Html.TextBoxFor(model => model.ProUnForHouInfo.LEGALTEL2, new { @class = "" })
                        @Html.ValidationMessageFor(model => model.ProUnForHouInfo.LEGALTEL2)
                    </p>
                    <p>
                        <label>
                            实际控制人：</label>
                        @Html.TextBoxFor(model => model.ProUnForHouInfo.CONBY, new { @class = "" })
                        @Html.ValidationMessageFor(model => model.ProUnForHouInfo.CONBY)
                    </p>
                    <p>
                        <label>
                            实际控制人手机1：</label>
                        @Html.TextBoxFor(model => model.ProUnForHouInfo.CONBYTEL, new { @class = "" })
                        @Html.ValidationMessageFor(model => model.ProUnForHouInfo.CONBYTEL)
                    </p>
                    <p>
                        <label>
                            实际控制人手机2：</label>
                        @Html.TextBoxFor(model => model.ProUnForHouInfo.CONBYTEL2, new { @class = "" })
                        @Html.ValidationMessageFor(model => model.ProUnForHouInfo.CONBYTEL2)
                    </p>
                    <div class="divider" />
                    <table class="list nowrap itemDetail" addbutton="股东结构-新建行" width="90%">
                        <thead>
                            <tr>
                                <th type="text" name="ProShareHolderInfos[#index#].Name" size="12" fieldclass="required">
                                    @Html.Hidden("ProShareHolderInfos[#index#].PROID", Model.ID)
                                    @Html.Hidden("ProShareHolderInfos[#index#].REGINFOID", Model.REGINFOID)
                                    主要股东名称
                                </th>
                                <th type="text" name="ProShareHolderInfos[#index#].Address" size="12" fieldclass="required">
                                    现住址
                                </th>
                                <th type="text" name="ProShareHolderInfos[#index#].Tel" size="12" fieldclass="required">
                                    电话
                                </th>
                                <th type="text" name="ProShareHolderInfos[#index#].Funded" size="12" fieldclass="">
                                    出资方式
                                </th>
                                <th type="text" name="ProShareHolderInfos[#index#].Amount" size="12" fieldclass="number">
                                    金额
                                </th>
                                <th type="text" name="ProShareHolderInfos[#index#].Ratio" size="12" fieldclass="number">
                                    股权比例
                                </th>
                                <th type="enum" name="ProShareHolderInfos[#index#].IsPayed" size="12" enumurl="DianDang/Apply/ProInfo/IsPayed">
                                    是否到位
                                </th>
                                <th type="del" width="60">
                                    操作
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            @foreach (var item in ShareHolderInfos)
                            {
                               
                                <tr>
                                    <td>
                                        @Html.Hidden("ProShareHolderInfos[" + index.ToString() + "].PROID", item.PROID)
                                        @Html.Hidden("ProShareHolderInfos[" + index.ToString() + "].REGINFOID", item.REGINFOID)
                                        @Html.TextBox("ProShareHolderInfos[" + index.ToString() + "].Name", item.NAME, new { @style = "width:100px" })
                                    </td>
                                    <td>@Html.TextBox("ProShareHolderInfos[" + index.ToString() + "].ADDRESS", item.ADDRESS, new { @style = "width:100px" })
                                    </td>
                                    <td>@Html.TextBox("ProShareHolderInfos[" + index.ToString() + "].TEL", item.TEL, new { @style = "width:100px" })
                                    </td>
                                    <td>@Html.TextBox("ProShareHolderInfos[" + index.ToString() + "].FUNDED", item.FUNDED, new { @style = "width:100px" })
                                    </td>
                                    <td>@Html.TextBox("ProShareHolderInfos[" + index.ToString() + "].AMOUNT", item.AMOUNT, new { @style = "width:100px", @class = "number" })
                                    </td>
                                    <td>@Html.TextBox("ProShareHolderInfos[" + index + "].RATIO", item.RATIO, new { @style = "width:100px", @class = "number" })
                                    </td>
                                    <td>
                                        <select class="combox" name='@("ProShareHolderInfos[" + index + "].IsPayed")'>
                                            <option value="0"  @(item.ISPAYED == 0 ? "selected='selected'" : "")>否</option>
                                            <option value="1"  @(item.ISPAYED == 1 ? "selected='selected'" : "")>是</option>
                                        </select>
                                    </td>
                                    <td>
                                        <a href="javascript:void(0)" class="btnDel">删除</a>
                                    </td>
                                </tr>
                                index++;
                            }
                        </tbody>
                    </table>
                    <div class="divider" />
                    <p>
                        <label>
                            公司地址：</label>
                        @Html.TextBoxFor(model => model.ProUnForHouInfo.CORPADDRESS, new { @class = "" })
                        @Html.ValidationMessageFor(model => model.ProUnForHouInfo.CORPADDRESS)
                    </p>
                    <p>
                        <label>
                            注册资本：</label>
                        @Html.TextBoxFor(model => model.ProUnForHouInfo.REGAMOUNT, new { @class = "number" })
                        @Html.ValidationMessageFor(model => model.ProUnForHouInfo.REGAMOUNT)
                        (万元)
                    </p>
                    <p style="width: 95%; height: 50px">
                        <label>
                            主营业务：</label>
                        @Html.TextAreaFor(model => model.ProUnForHouInfo.MAINBUSS, new { @class = "", @maxlength = "50", @style = "width:80%;" })
                        @Html.ValidationMessageFor(model => model.ProUnForHouInfo.MAINBUSS)
                    </p>
                    <p>
                        <label>
                            借款金额：</label>
                        @Html.TextBoxFor(model => model.AMOUNT, new { @class = "" })
                        <span>&nbsp;万元</span>
                        @Html.ValidationMessageFor(model => model.AMOUNT)
                    </p>
                    <p>
                        <label>
                            贷款期限：</label>
                        @Html.TextBoxFor(model => model.LOANPHASE, new { @class = "number" })
                        @Html.ValidationMessageFor(model => model.LOANPHASE)
                        @Html.RadioButtonFor(model => model.LOANPHAESTYPE, 0)
                        天&nbsp;
                        @Html.RadioButtonFor(model => model.LOANPHAESTYPE, 1)
                        月
                    </p>
                    <p>
                        <label>
                            综合费率：</label>
                        @Html.TextBoxFor(model => model.GENERALRATE, new { @class = "number" })%
                        @Html.ValidationMessageFor(model => model.GENERALRATE)
                    </p>
                    <p>
                        <label>
                            利率：</label>
                        @Html.TextBoxFor(model => model.RATE, new { @class = "number" })%
                        @Html.ValidationMessageFor(model => model.RATE)
                    </p>
                    <p>
                        <label>
                            管理费率：</label>
                        @Html.TextBoxFor(model => model.MANAGEFEERATE, new { @class = "number" })%
                        @Html.ValidationMessageFor(model => model.MANAGEFEERATE)
                    </p>
                    <p>
                        <label>
                            还款方式：</label>
                        @Html.DropDownListFor(model => model.ProUnForHouInfo.REPAYMENT, ddlRepayment, new { @class = "combox", @selectedvalue = Model.ProUnForHouInfo.REPAYMENT })
                        @Html.ValidationMessageFor(model => model.ProUnForHouInfo.REPAYMENT)
                    </p>
                    <p>
                        <label>
                            预收费用：</label>
                        @Html.TextBoxFor(model => model.ProUnForHouInfo.ADVAMT, new { @class = "number" })
                        元
                        @Html.ValidationMessageFor(model => model.ProUnForHouInfo.ADVAMT)
                    </p>
                    <p style="width: 95%; height: 50px">
                        <label>
                            用途：</label>
                        @Html.TextAreaFor(model => model.ProUnForHouInfo.USEFOR, new { @class = "", @maxlength = "50", @style = "width:80%;" })
                        @Html.ValidationMessageFor(model => model.ProUnForHouInfo.USEFOR)
                    </p>
                    <p style="width: 95%; height: 50px">
                        <label>
                            业务简述：</label>
                        @Html.TextAreaFor(model => model.ProUnForHouInfo.BUSSBRIEF, new { @class = "", @maxlength = "1000", @style = "width:80%;" })
                        @Html.ValidationMessageFor(model => model.ProUnForHouInfo.BUSSBRIEF)
                    </p>
                    <p style="width: 95%; height: 50px">
                        <label>
                            贷款方式：</label>
                        @Html.TextAreaFor(model => model.ProUnForHouInfo.LOANMODE, new { @class = "", @maxlength = "500", @style = "width:80%;" })
                        @Html.ValidationMessageFor(model => model.ProUnForHouInfo.LOANMODE)
                    </p>
                    <p style="width: 95%; height: 50px">
                        <label>
                            还款来源：</label>
                        @Html.TextAreaFor(model => model.ProUnForHouInfo.REPAYSOURCE, new { @class = "", @maxlength = "500", @style = "width:80%;" })
                        @Html.ValidationMessageFor(model => model.ProUnForHouInfo.REPAYSOURCE)
                    </p>
                </div>
                <div class="formBar">
                    <ul>
                        <li>
                            <div class="buttonActive">
                                <div class="buttonContent">
                                    <button type="submit">
                                        保存</button></div>
                            </div>
                        </li>
                    </ul>
                </div>
                </form>
            </div>
            <div>
            </div>
            <div>
                <div id="divProTarInfoCreate">
                </div>
                <div id="divProTarInfoList">
                </div>
            </div>
            <div>
                <div>
                    <div id="divProConInfoCreate">
                    </div>
                    <div id="divProConInfoList">
                    </div>
                </div>
            </div>
            <div>
                <div id="divProFilesInfoCreate">
                </div>
                <div id="divProFilesInfoList">
                </div>
            </div>
            <div id="divGetSumbit">
            </div>
        </div>
    </div>
</div>
<script>
    $(function () {
    var id=@Model.ID;
    if (id > 0){
        RefreshProTarInfoCreate(0);
        RefreshProTarInfoList();
        RefreshProConInfoCreate(0);
        RefreshProConInfoList();
        RefreshProFilesInfoCreate(0);
        RefreshProFilesInfoList();
        }
    });
    function RefreshProTarInfoList() {
        $("#divProTarInfoList").loadUrl("DianDang/Apply/ProInfo/TarInfoList/@Model.ID", {}, function () {
            $("#divProTarInfoList").find("[layoutH]").layoutH();
        });
    }
    function RefreshProTarInfoCreate(id) {
        $("#divProTarInfoCreate").loadUrl("DianDang/Apply/ProInfo/TarInfoCreate/"+id+"?CreateNewFlag=0&proID=@Model.ID&regid=@Model.REGINFOID", {}, function () {
            $("#divProTarInfoCreate").find("[layoutH]").layoutH();
        });
    }
    function SaveProTarInfoCreate(n) {
        $("#CreateNewFlag").attr("value",n);
        $("#btn_toSave").click();
    }
    function RefreshProConInfoList() {
        $("#divProConInfoList").loadUrl("DianDang/Apply/ProInfo/ConInfoList/@Model.ID", {}, function () {
            $("#divProConInfoList").find("[layoutH]").layoutH();
        });
    }
    function RefreshProConInfoCreate(id) {
        $("#divProConInfoCreate").loadUrl("DianDang/Apply/ProInfo/ConInfoCreate/"+id+"?proID=@Model.ID&regid=@Model.REGINFOID", {}, function () {
            $("#divProConInfoCreate").find("[layoutH]").layoutH();
        });
    }
    function RefreshProFilesInfoList() {
        $("#divProFilesInfoList").loadUrl("DianDang/Apply/ProInfo/FilesInfoList/@Model.ID", {}, function () {
            $("#divProFilesInfoList").find("[layoutH]").layoutH();
        });
    }
    function RefreshProFilesInfoCreate(id) {
        $("#divProFilesInfoCreate").loadUrl("DianDang/Apply/ProInfo/FilesInfoCreate/"+id+"?proID=@Model.ID&regID=@Model.REGINFOID", {}, function () {
            $("#divProFilesInfoCreate").find("[layoutH]").layoutH();
        });
    }
    function GetSumbit()
    {
    $("#divGetSumbit").loadUrl("DianDang/Apply/ProInfo/SumbitInfo/@Model.ID");
    }
   
</script>
